package in.iqing;

import android.os.Bundle;

import in.iqing.base.BaseApplication;
import in.iqing.control.helper.ImageHelper;
import in.iqing.model.db.DBHelper;

/**
 * Created by neavo on 2014/5/15.
 */

public class App extends BaseApplication {
    private static App instance;

    @Override
    protected void onInitialize(Bundle savedInstanceState) {
        super.onInitialize(savedInstanceState);

        instance = this;
        initImageHelper();
        initDBHelper();
    }

    public static App getInstance() {
        return instance;
    }


    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);

        // TODO:定时清除插画缓存与Picasso缓存
        // TODO:书籍页面筛选和排序
        // TODO:自动书签与最近阅读
    }

    private void initImageHelper() {
        ImageHelper.getSingleton(getContext()).onInitialize();
    }

    private void initDBHelper() {
        DBHelper.getInstance().onInitialize(this);
    }
}
